package test3;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: Hua YY
 * Date: 2025-02-01
 * Time: 12:42
 */
class WangEr{
    public void talk(){
        System.out.println("我真帅");
    }
}

class WangXiaoEr extends WangEr{
    @Override
    public void talk(){
        System.out.println("我比我爹还帅");
    }
}
public class Test1 {
    public static void main(String[] args) {
        WangEr[] wangErs = {new WangEr(),new WangXiaoEr()};
        for (WangEr wangEr : wangErs){
            wangEr.talk();
        }
    }
}
